<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Rag Hu
 * Created Time: 2019/7/27 17:55
 * Modified Time: 2019/7/27 17:55
 * Version: 2.0
 */

namespace App\Modules\Store\Validators;


use Flower\Core\Repository\Contracts\ValidatorInterface;
use Flower\Core\Repository\Validator\LaravelValidator;

class StorePaymentRoyaltyValidator extends LaravelValidator
{
    protected $rules = [
        ValidatorInterface::RULE_CREATE => [
            'store_id' => 'required',
            'wechat'=> 'required|numeric|min:0|max:100',
            'alipay'=> 'required|numeric|min:0|max:100',
            'cash'=> 'required|numeric|min:0|max:100',
            'bank_card'=> 'required|numeric|min:0|max:100',
            'group_buy'=> 'required|numeric|min:0|max:100',
            'member_card'=> 'required|numeric|min:0|max:100'
        ],
        ValidatorInterface::RULE_UPDATE => [
            'wechat'=> 'filled|numeric|min:0|max:100',
            'alipay'=> 'filled|numeric|between:0,100',
            'cash'=> 'filled|numeric|min:0|max:100',
            'bank_card'=> 'filled|numeric|min:0|max:100',
            'group_buy'=> 'filled|numeric|min:0|max:100',
            'member_card'=> 'filled|numeric|min:0|max:100'
        ]
    ];

    protected $messages = [
        'wechat.min' => '提成请设置在0%-100%之间',
        'wechat.max' => '提成请设置在0%-100%之间',

        'alipay.min' => '提成请设置在0%-100%之间',
        'alipay.max' => '提成请设置在0%-100%之间',

        'cash.min' => '提成请设置在0%-100%之间',
        'cash.max' => '提成请设置在0%-100%之间',

        'bank_card.min' => '提成请设置在0%-100%之间',
        'bank_card.max' => '提成请设置在0%-100%之间',

        'group_buy.min' => '提成请设置在0%-100%之间',
        'group_buy.max' => '提成请设置在0%-100%之间',

        'member_card.min' => '提成请设置在0%-100%之间',
        'member_card.max' => '提成请设置在0%-100%之间',


    ];
}